<template>
	<view class="page-index">
		<!-- <view class="userBox" v-if="userInfo.mobile">
			<view class="userInfo">
				<image :src="userInfo.avatar" style="width: 100rpx;height: 100rpx;border-radius: 50%;"></image>
				<view class="" style="margin-left: 24rpx;color: #fff;">
					{{userInfo.nickname}}
				</view>
			</view>
		</view>
		<button class="userBox" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" v-else>
			<view class="userInfo">
				<image src="/static/tabbar/user-1.png" style="width: 100rpx;height: 100rpx;border-radius: 50%;"></image>
				<view class="" style="color: #fff;">
					请点击登录
				</view>
			</view>
		</button> -->
		<view class="topBox" :style="{ 'padding-top': menu.top + 'px' }">
			<view class="titleBox" :style="{ height: menu.bottom - menu.top + 'px' }"><view class="title1">我的</view></view>
			<view class="userInfo" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" v-if="token">
				<image :src="userInfo.avatar" class="avatar"></image>
				<view class="infos">
					<view class="nickname">{{ userInfo.nickname }}</view>
				</view>
			</view>
			<button class="userInfo" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" v-else>
				<image src="/static/home/login.png" class="avatar"></image>
				<view class="login">请点击登录</view>
			</button>
		</view>

		<!-- 		<view class="buttonBox">
			<button v-for="(item, index) in list" :key="index" class="buttonItem" :open-type="item.open ? item.open : ''" @click="jump(item)">
				<image :src="item.image" class="buttonImage"></image>
				{{ item.name }}
			</button>
		</view> -->
		<view class="cardBox" v-if="token">
			<view class="cardList">
				<view class="cardItem" v-for="(item, index) in list" :key="index" @click="jump(item)">
					<view class="itemLeft">
						<image :src="item.image" style="width: 40rpx;height: 40rpx;flex-shrink: 0;"></image>
						<view class="itemName">{{ item.name }}</view>
					</view>
					<view class="itemRight"><uni-icons type="right" size="14"></uni-icons></view>
				</view>
			</view>
		</view>
		<button class="cardBox" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" v-else>
			<view class="cardList">
				<view class="cardItem" v-for="(item, index) in list" :key="index" @click="jump(item)">
					<view class="itemLeft">
						<image :src="item.image" style="width: 40rpx;height: 40rpx;flex-shrink: 0;"></image>
						<view class="itemName">{{ item.name }}</view>
					</view>
					<view class="itemRight"><uni-icons type="right" size="14"></uni-icons></view>
				</view>
			</view>
			<view class="cardList" v-if="userInfo.level==2">
				<view class="cardItem" v-for="(item, index) in list2" :key="index" @click="jump(item)">
					<view class="itemLeft">
						<image :src="item.image" style="width: 40rpx;height: 40rpx;flex-shrink: 0;"></image>
						<view class="itemName">{{ item.name }}</view>
					</view>
					<view class="itemRight"><uni-icons type="right" size="14"></uni-icons></view>
				</view>
			</view>
		</button>
	</view>
</template>

<script src="./page.js"></script>

<style scoped lang="scss">
@import 'page.scss';
</style>
